package com.stenio.fancat.mapper;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.stenio.fancat.domain.Activity;
import com.stenio.fancat.domain.bo.ActivityBO;

/**
 * 活动模块相关Mapper接口
 */
@Repository
public interface ActivityMapper extends BaseMapper<Activity> {
	int deleteByPrimaryKey(Integer id);

	int insertSelective(Activity record);

	Activity selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(Activity record);

	int updateByPrimaryKey(Activity record);

	/**
	 * 分页查询活动、活动统计表信息
	 * 
	 * @param page
	 * @param act
	 * @return
	 */
	List<ActivityBO> selectByConditionPage(Pagination page, Activity act);

	/**
	 * 通过用户id查询此用户支出金额，活动总金额-剩余金额
	 * 
	 * @param userId
	 *            用户id
	 * @return 支出金额
	 */
	Integer selectExpenditureByUserId(Integer userId);

}